package ojresult

type Result struct {
	Code   int
	Status bool
	Data   map[string]string
}

//constructor method
func NewResult() *Result {
	return &Result{Data: make(map[string]string)}
}

func (this *Result) SetMessage(code int, status bool) {
	this.Code = code
	this.Status = status
}

// add data
func (this *Result) AddData(key string, val string) {
	this.Data[key] = val
}

//del one data
func (this *Result) DelData(key string) {
	delete(this.Data, key)
}

//del all data
func (this *Result) RemoveData() {
	this.Data = make(map[string]string)
}
